Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@bitcoinerlab/secp256k1
Advanced tools
A library for performing elliptic curve operations on the secp256k1 curve. It is designed to integrate into the BitcoinJS & BitcoinerLAB ecosystems and uses the audited noble-secp256k1 library. It is compatible with environments that do not support WASM,
@bitcoinerlab/secp256k1 is a Javascript library for performing elliptic curve operations on the secp256k1 curve. It is designed to integrate into the BitcoinJS and BitcoinerLAB ecosystems and uses the audited noble-secp256k1 library, created by Paul Miller.
This library is compatible with environments that do not support WebAssembly, such as React Native.
To install the package, use npm:
npm install @bitcoinerlab/secp256k1
This implementation follows the tiny-secp256k1 API. Please refer to tiny-secp256k1 for documentation on the methods.
This method is not yet implemented: xOnlyPointAddTweakCheck
. It is not used in ecpair or bip32, though.
You can test the examples in this section using the online playground demo available at https://bitcoinerlab.com/modules/secp256k1.
import ecc from '@bitcoinerlab/secp256k1';
import { BIP32Factory } from 'bip32';
import { ECPairFactory } from 'ecpair';
const BIP32 = BIP32Factory(ecc);
const ECPair = ECPairFactory(ecc);
const keyPair1 = ECPair.fromWIF(
'KynD8ZKdViVo5W82oyxvE18BbG6nZPVQ8Td8hYbwU94RmyUALUik'
);
const node = BIP32.fromBase58(
'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi'
);
@noble/secp256k1 uses Javascript BigInt
, which is fully supported in React Native on iOS. However, to use it on Android, you must make sure you use the Hermes Javascript Engine, available from RN-0.70 release.
The project was initially developed and is currently maintained by Jose-Luis Landabaso. Contributions and help from other developers are welcome.
Here are some resources to help you get started with contributing:
To download the source code and build the project, follow these steps:
git clone https://github.com/bitcoinerlab/secp256k1.git
npm install
npm run build
This will build the project and generate the necessary files in the dist
directory.
Before committing any code, make sure it passes all tests by running:
npm run test
This project is licensed under the MIT License.
Thanks to Paul Miller for creating and maintaining the noble-secp256k1 library, upon which this library is based.
Thanks to the BitcoinJS team for creating and maintaining the BitcoinJS ecosystem, including the ecpair and bip32 libraries, which this library is designed to integrate with.
Thanks to the tiny-secp256k1 team for creating and maintaining the tiny-secp256k1 library, which this library uses for testing.
FAQs
A library for performing elliptic curve operations on the secp256k1 curve. It is designed to integrate into the BitcoinJS & BitcoinerLAB ecosystems and uses the audited noble-secp256k1 library. It is compatible with environments that do not support WASM,
The npm package @bitcoinerlab/secp256k1 receives a total of 22,557 weekly downloads. As such, @bitcoinerlab/secp256k1 popularity was classified as popular.
We found that @bitcoinerlab/secp256k1 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.